@extends('admin.layout.empty')

@section('content')
<div class="layui-col-lg12">
    {{-- <div class="layui-card"> --}}
        <div class="layui-card-body">
            <form class="layui-form" method="post" action="@empty($row['id']) @broute('setting.store') @else @broute('setting.update') @endempty">
                <div class="layui-form-item">
                    <label class="layui-form-label">配置类型</label>
                    @empty($row['id'])
                    <div class="layui-input-block">
                        <input type="text" name="type" lay-verify="" placeholder="以英文开始的英文、数字、_组合，长度不能超过20" autocomplete="off" class="layui-input" list="types">
                        <datalist id="types">
                            @foreach ($types as $type)
                                <option value="{{$type}}">
                            @endforeach
                        </datalist>
                    </div>
                    @else
                    <div class="layui-form-mid layui-word-aux">
                        {{$row['type']??''}}
                    </div>
                    @endempty
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">配置项</label>
                    @empty($row['id'])
                    <div class="layui-input-block">
                        <input type="text" name="name" required lay-verify="required" placeholder="以英文开始的英文、数字、_组合，长度不能超过20" autocomplete="off" class="layui-input" value="{{ $row['name']??'' }}">
                    </div>
                    @else
                    <div class="layui-form-mid layui-word-aux">
                        {{$row['name']??''}}
                    </div>
                    @endempty
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">配置值</label>
                    <div class="layui-input-block">
                        <textarea name="value" placeholder="请输入配置值" required lay-verify="required" class="layui-textarea">{{$row['value']??''}}</textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">描述</label>
                    <div class="layui-input-block">
                        <textarea name="description" placeholder="请输入描述" class="layui-textarea">{{$row['description']??''}}</textarea>
                    </div>
                </div>

                <div class="layui-form-item  layui-hide">
                    <div class="layui-input-block">
                        @empty($row['id'])
                        @else
                        <input type="hidden" name="id" value="{{$row['id']}}">
                        @endempty
                        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
                    </div>
                </div>
            </form>
        </div>
    {{-- </div> --}}
</div>
@endsection